﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using QuartzServices.Domain.DomainModels;

namespace QuartzServices.Infrastructure.Mappings
{
    internal class SerilogMap: IEntityTypeConfiguration<SerilogModel>
    {
        public void Configure(EntityTypeBuilder<SerilogModel> entity)
        {

            entity.HasKey(e=>e.Id);

            entity.Property(e => e.FilePath).HasMaxLength(300);
            entity.Property(e => e.Id)
                .IsUnicode(false)
                .HasDefaultValueSql("(newid())")
                .HasMaxLength(64);
            entity.Property(e => e.LineNumber).HasMaxLength(10);
            entity.Property(e => e.MemberName).HasMaxLength(50);
            entity.Property(e => e.ThreadId).HasMaxLength(10);
            entity.Property(e => e.TimeStamp).HasColumnType("datetime");
        }
    }
}
